#ifndef TASK_H
#define TASK_H

#include <QString>
#include <QUrl>

struct Task {
    enum Priority {
        LOW = 0,
        MEDIUM,
        HIGH
    };

    enum State {
        FINISHED = 0,
        REDY,
        ERROR
    };

    Task(QUrl url, QString path) :
        url(url), path(path), progress(0), priority(MEDIUM), state(REDY) {}

    QUrl url;
    QString path;
    int progress;
    int priority;
    int state;

    bool operator<(const Task& task) {
        return priority < task.priority;
    }

    static const int FIELD_QUANTITY = 5;
};

enum TaskFields {
    URL = 0,
    PATH,
    PROGRESS,
    PRIORITY,
    STATE
};

#endif // TASK_H
